home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 43
/
Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso
/
-serious-
/
comms
/
other
/
ftransapiv
/
arexx
/
ftransfinalwriter.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-06-14
|
3KB
|
108 lines
/*
---------------------------------------------
FinalWriter Translator By FTranslator Client
Script by Cristian Robert Gallas
Tested with Final Writer 97
Usage:
Use in ARexx interface of FinalWriter
$VER: FTransFINALWRITER.rexx v0.01 (16.08.96)
---------------------------------------------
HISTORY
----------------------------------------
v0.01b [16.08.98] - First public beta version.
----------------------------------------
[Steps installation]
> Copy FTransFINALWRITER.rexx to FinalWriter:FWMacros/
> Go to User/Other/Preferences
> Click NEW
> Menu Item Name Portuguese->English (This is a example)
> Command Type, select ARexx Script
> Click in Select and selection FTransFINALWRITER.rexx
> PUT IN AREXX SOURCE CODE, LINE 50 NUMBER OF TRANSLATION DIRECTION
ITS NEEDED BECAUSE FINALWRITER AREXX INTERFACE IS LIMITED
> If like select shortcut and menu position
> Now Save
> Select text and click on User/Portuguese->English
> Its open new window with translation... :)
0 - English to Francais
1 - English to Deutsch
2 - English to Italiano
3 - English to Portugues
4 - English to Espanol
5 - Francais to English
6 - Deutsch to English
7 - Italiano to English
8 - Espanol to English
9 - Portugues to English
*/
Options Results
tmpfile = 'Ram:FTransTmp.FINALWRITER'
tmpclip = 'Ram:FTransFinalWriter.Clip'
/* TRADUZ = TRANSLATION DIRECTION */
/* EXAMPLE TRADUZ = "3" */
/*++++++++++++++++++++++++++++++++*/
traduz = ""
/*++++++++++++++++++++++++++++++++*/
/* TESTA SE A DIRECAO DA TRADUCAO FOI INFORMADA */
if traduz = "" then do
SHOWMESSAGE 1 1 '"PUT IN FTransFINALWRITER.rexx SCRIPT LINE 50, TRANSLATION DIRECTION..." "" "" "Ok" "" ""'
exit
end
/* TESTA SE PODE SER USADAS AS LIBS DO AREXX */
if ~show(l, "rexxsupport.library") then
if ~addlib("rexxsupport.library", 0, -30) then
exit
if ~show(l, "rexxtricks.library") then
if ~addlib("rexxtricks.library", 0, -30) then
exit
/* TESTA SE O PROGRAMA JA NAO ESTA COM A PORTA DE TRADUCAO ABERTA */
if exists(tmpfile) then do
SHOWMESSAGE 1 1 '"FTranslation port is open! Translation in progress, wait..." "" "" "Ok" "" ""'
exit
end
COPY
/* PEGA O CONTEUDO DO CLIPBOARD */
sel = ReadClipboard(0)
/* TESTA SE FOI SELECIONADO O TEXTO */
if sel = "" then do
SHOWMESSAGE 1 1 '"You need select text first..." "" "" "Ok" "" ""'
exit
end
call open(1, tmpclip, 'W')
call writeln(1, sel)
call close(1)
/* COLOCA COMO DEFAULT PORTUGUES TO ENGLISH */
if traduz = "" then
traduz = 3
/* EXECUTA O FTRANSLATOR COM OS ARGUMENTOS DA TRADUCAO */
comando = 'C:FTranslator FILE 'traduz' "'tmpclip'" SILENCE > 'tmpfile
Address Command comando
Address Command 'Delete "'tmpclip'"'
OPEN tmpfile
Address Command 'Delete "'tmpfile'"'
exit